package com.controller.front;

import java.util.List;
import java.util.Map;

import org.apache.catalina.filters.AddDefaultCharsetFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.service.front.IMvFrontService;
@RequestMapping("/front")
@Controller
public class MvFrontController {

	//调用业务逻辑层
	@Autowired
	private IMvFrontService iMvService;
	
	@RequestMapping("/mv_list")
	public String mv_list(Model model){
		List<Map<String, Object>> mvList = iMvService.list();
		model.addAttribute("mvList", mvList);
		
		List<Map<String,Object>> queryMvTypeList = iMvService.queryMvType();
		model.addAttribute("queryMvTypeList", queryMvTypeList);
		return "mv";
	}
	
	@RequestMapping("/queryMvTypeId")
	public String queryMvTypeId(Model model,Integer mvTypeId) {
		List<Map<String, Object>> queryMvTypeIdList = iMvService.queryMvTypeId(mvTypeId);
		model.addAttribute("queryMvTypeIdList", queryMvTypeIdList);
		
		List<Map<String,Object>> queryMvTypeList = iMvService.queryMvType();
		model.addAttribute("queryMvTypeList", queryMvTypeList);
		return "mv";
	}
}
